<?php

/*
 * 操作记录模型
 * @author turtle
 * create_time 2017-01-04
 */


namespace App\Admin\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;

class Logs extends Model {
    protected $table = 'admin_operation_log';

    /*
     * 添加操作记录
     * @author turtle
     * create_time 2017-01-04
     */

    public static function addLog($log) {
        $log = array(
            'operator' => Auth::user()->name,
            'log' => $log,
            'created_at' => date('Y-m-d H:m:s'),
            'updated_at' => date('Y-m-d H:m:s')
        );
        self::insert($log);
    }

}
